package com.blockmeta.bbs.baselibrary.base.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author AirThor
 * @date 2018/6/21.
 */

public class FragmentVPAdapter extends FragmentPagerAdapter {
    private List<Fragment> mFragments;
    public FragmentVPAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        mFragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments==null?0:mFragments.size();
    }
}
